<link href="../addons/jy_friends_shop/custom/templates/mobile/style.css" rel="stylesheet">
<div class='fui-page fui-page-current page-commission-myshop'>
	<i class="icon icon-qrcode" id="alert-click" ng-click="access_json('/agent.qrcode//mid='+pagedata.mid)"></i>
    <div class='fui-content navbar'>
	<div class="myshop-header">
	    <div class="image">
			<img ng-src="{{tomedia(pagedata.myshop.img) || '../addons/jy_friends_shop/resource/images/myshoptop.jpg'}}"  />
	    </div>	   
	    <div class="menus">
		<div class='shopname'>
	      {{pagedata.myshop.title || '未定义小店名称'}}
	    </div>
		<div class="shoplogo">
		    <img ng-src="{{tomedia(pagedata.myshop.logo) || '../core/resource/images/nopic.jpg'}}"  />
		</div>
		<div class="nav btn-qrcode"  ng-click="access_json('/agent.qrcode//mid='+pagedata.mid)">
		    <p><i class="icon jinyunicon icon-qrcode"></i></p>
		    <p>二维码</p> 
		</div>
		<div onclick="$('#show_kfewm_modal').modal()" class="nav btn-favorite">
			<p><i class="icon icon-phone"></i></p>
			<p>联系客服</p>
		</div>
	    </div>
		
	</div>
	<div class="fui-searchbar">
	    <div class="searchbar center">
		<div class="search-input">
		    <input type="search" ng-model="pagedata.params.title" class="search" placeholder="输入关键字...">
		</div>
		
	    </div>
	</div>
	 <div class="fui-line">
	         <div class="text text-danger"><i class="icon icon-hotfill"></i> 小店推荐</div>
	 </div>
	<div class="fui-goods-group block" id='container'>
	<div ng-repeat="g in pagedata.list" id="goodslist" class="fui-goods-item">
			<a ng-click="access_json('jy_weishop/goods.detail//id='+g.goodsid)">
						<div class="image" style="background-image:url('{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}')">
							<div ng-if="g.total<=0" class="salez" style="background-image: url('{{tomedia(pagedata.shopset.saleout)}}'); "></div>
						</div>
			</a>
			<div class="detail">
						<a ng-click="access_json('jy_weishop/goods.detail//id='+g.goodsid)">
							<div class="name">{{g.title}}</div>
						</a>
						<div class="price">
							<span class="text">￥{{g.price}}</span>
							
						</div>
			</div>
	</div>
	</div>
	<div ng-if="loading" class='infinite-loading' style="text-align: center; color: #666;">
		<span class='fui-preloader'></span>
		<span class='text'> 正在加载...</span>
	</div>
    </div>
	<div ng-if="pagedata.list.length<1" style="text-align: center; color: #666;">
		<span class="text"> 暂无商品</span>
	</div>
</div>
<!--客服二维码展示弹层-->
<div id="show_kfewm_modal" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:80%;left:10%;top:20%">
	<div class="modal-content" style="padding:0.5rem">
		<div class="title c">请长按扫描下面的二维码联系客服</div>
		<div class="image"><img style="width:100%" ng-src="{{tomedia(pagedata.myshop.kfewm) || '../core/resource/images/nopic.jpg'}}"></img></div>
	</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.pagedata.get_list=function(){

	if(scope.pagedata.loading || scope.pagedata.loaded){
		return;
	}
	scope.pagedata.loading=true;
	$('#loading_show').show();
	var query=scope.made_query(scope.pagedata.params);
	scope.get('//list/'+query,function(res){
		
		
		scope.pagedata.loading=false;
		$('#loading_show').hide();
		if(res=='none'){
			scope.pagedata.loaded=true;
			return;
		}
		if(!Array.isArray(res)){
			scope.message('获取数据失败！');
			return;
		}
		if(res.length<scope.pagedata.psize){
			scope.pagedata.loaded=true;
		}
		if(!scope.pagedata.list){
			scope.pagedata.list=[];
		}
		res.forEach(function(row){
			scope.pagedata.list.push(row);
		});
		scope.pagedata.params.page++;
		
	});
	
}
scope.pagedata.scroll_bottom=function(){
	scope.pagedata.get_list();
}
scope.pagedata.params={'page':1};
scope.pagedata.get_list();
</script>